package com.usian.admin.controller;

import com.usian.admin.service.AdSensitiveService;
import com.usian.apis.admin.AdSensitiveControllerApi;
import com.usian.model.admin.dtos.SensitiveDto;
import com.usian.model.admin.pojos.AdSensitive;
import com.usian.model.common.dtos.ResponseResult;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/sensitive")
public class AdSensitiveController implements AdSensitiveControllerApi {
    @Autowired
    private AdSensitiveService adSensitiveService;
    @RequestMapping("/list")
    @Override
    @ApiImplicitParam(name = "dto",type = "SensitiveDto",value ="查询条件" )
    public ResponseResult list(@RequestBody SensitiveDto dto) {
        return adSensitiveService.list(dto);
    }

    @Override
    @RequestMapping("/save")
    public ResponseResult inster(@RequestBody AdSensitive adSensitive) {
        return adSensitiveService.insert(adSensitive);
    }

    @Override
    @RequestMapping("/update")
    public ResponseResult update(@RequestBody  AdSensitive adSensitive) {
        return adSensitiveService.update(adSensitive);
    }

    @Override
    @RequestMapping("/del/{id}")
    public ResponseResult deleteById(@PathVariable(value = "id") Integer id) {
        return adSensitiveService.deleteById(id);
    }
}
